﻿<%@ Page Title="Lab Management" Language="C#" MasterPageFile="~/Lab.master" AutoEventWireup="true" CodeFile="LabManagement.aspx.cs" Inherits="LabManagement" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="Server">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>Daftar Laboratorium</h2>
                <ul class="nav navbar-right panel_toolbox">
                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="#">Settings 1</a>
                            </li>
                            <li><a href="#">Settings 2</a>
                            </li>
                        </ul>
                    </li>
                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>

            <div class="x_content">
                <div class="table-responsive">
                    <asp:Repeater ID="userList" runat="server">
                        <HeaderTemplate>
                            <table class="table table-striped jambo_table bulk_action" id="tblEditable">
                                <thead>
                                    <tr class="headings">
                                        <th class="column-title">ID</th>
                                        <th class="column-title">Nama Lab</th>
                                    </tr>
                                </thead>
                                <tbody>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr class="even pointer">
                                <td class=" "><%# DataBinder.Eval(Container.DataItem, "ID") %></td>
                                <td class=" "><%# DataBinder.Eval(Container.DataItem, "NAMA_LAB") %></td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr class="odd pointer">
                                <td class=" "><%# DataBinder.Eval(Container.DataItem, "ID") %></td>
                                <td class=" "><%# DataBinder.Eval(Container.DataItem, "NAMA_LAB") %></td>
                            </tr>
                        </AlternatingItemTemplate>
                        <FooterTemplate>
                            </tbody>
                                    </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </div>
            </div>
        </div>

        <div class="x_panel">
            <div class="x_title">
                <h2>Tambah Laboratorium</h2>
                <ul class="nav navbar-right panel_toolbox">
                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="#">Settings 1</a>
                            </li>
                            <li><a href="#">Settings 2</a>
                            </li>
                        </ul>
                    </li>
                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <form method="post" runat="server">
                    <div class="input-group">
                    <input runat="server" type="text" id="namaLab" required="required" class="form-control" placeholder="Ketik nama Laboratorium" />
                    <span class="input-group-btn">
                        <asp:Button runat="server" ID="btnAdd" OnClick="btnAdd_Click" CssClass="btn btn-success" Text="Tambah Laboratorium" />
                    </span>
                    </div>
                </form>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="BodyFooterContainer" runat="Server">
    <script type="text/javascript">
        $('#tblEditable').Tabledit({
            url: 'DataManagement.aspx?ManageLab',
            deleteButton: true,
            saveButton: true,
            autoFocus: false,
            restoreButton: false,
            hideIdentifier: true,
            columns: {
                identifier: [0, 'id'],
                editable: [[1, 'nama']]
            },
            onDraw: function () {
                console.log('onDraw()');
            },
            onSuccess: function (data, textStatus, jqXHR) {
                new PNotify({
                    title: 'Edit Data Laboratorium Berhasil',
                    text: '',
                    type: 'success',
                    styling: 'bootstrap3'
                });
            },
            onFail: function (jqXHR, textStatus, errorThrown) {
                new PNotify({
                    title: 'Edit Data Laboratorium Gagal',
                    text: textStatus,
                    type: 'error',
                    styling: 'bootstrap3'
                });
            },
            onAlways: function () {
                console.log('onAlways()');
            },
            onAjax: function (action, serialize) {
                console.log('onAjax(action, serialize)');
                console.log(action);
                console.log(serialize);
            }
        });
    </script>
</asp:Content>

